package com.elinkway.infinitemovies.bean;

import android.text.TextUtils;

import com.lvideo.http.bean.LVideoBaseBean;

public class Favorite implements LVideoBaseBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6169463305187245019L;
	private String name;
	private String desc;
	private String vt;
	private String aid;
	private String src;
	private String nowEpisodes;
	private String latestEpisodes;
	private String isend;
	private String episodes;
	private long favoriteTime;
	private String poster;

	public String getPoster() {
		return poster;
	}

	public void setPoster(String poster) {
		this.poster = poster;
	}

	public void setEpisodes(String episodes) {
		this.episodes = episodes;
	}

	public String getEpisodes() {
		return episodes;
	}

	/**
	 * 获取最新剧集名，若为空，则取旧名称
	 * @return
	 */
	public String getLatestEpisodes() {
		return TextUtils.isEmpty(latestEpisodes)?getNowEpisodes():latestEpisodes;
	}

	public void setLatestEpisodes(String latestEpisodes) {
		this.latestEpisodes = latestEpisodes;
	}
	public String getIsend(){
		
		return isend;
	}
	
	public void setIsend(String isend){
		
		this.isend = isend;
	}
	public String getNowEpisodes(){
		
		return nowEpisodes;
	}
	
	public void setNowEpisode(String nowEpisodes){
		this.nowEpisodes = nowEpisodes;		
	}
	
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getVt() {
		return vt;
	}
	public void setVt(String vt) {
		this.vt = vt;
	}
	public String getAid() {
		return aid;
	}
	public void setAid(String aid) {
		this.aid = aid;
	}
	public String getSrc() {
		return src;
	}
	public void setSrc(String src) {
		this.src = src;
	}

	public long getFavoriteTime() {
		return favoriteTime;
	}

	public void setFavoriteTime(long favoriteTime) {
		this.favoriteTime = favoriteTime;
	}

	/**
	 * 检查是否存在更新剧集
	 * <p>
	 * 检查latestEpisodes字段与当前保存的nowEpisodes字段是否相同，如不相同则返回false，否则返回true
	 * </p>
	 * @return
	 */
	public boolean isUpdated(){
		return !TextUtils.equals(getNowEpisodes(), getLatestEpisodes()); 
	}
	/**
	 * 将最新剧集数保存至当前保存的集数
	 */
	public void setUpdate(){
		setNowEpisode(getLatestEpisodes());
	}
}
